﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Windows.Forms;

namespace MigrationTool
{
    /// <summary>
    /// 共通使用関数クラス
    /// </summary>
    public class CommonModule
    {
        #region メソッド
        /// <summary>
        /// 文字列検索
        /// </summary>
        /// <param name="targetString"></param>
        /// <param name="str"></param>
        /// <returns></returns>
        public bool SearchString(string targetString, string str)
        {
            if (str == string.Empty)
            {
                return false;
            }
            if (targetString.IndexOf(str) >= 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// ログ出力
        /// </summary>
        /// <param name="strDetail"></param>
        public void WriteLog(TextBox txtTarget, string strDetail)
        {
            txtTarget.AppendText(DateTime.Now.ToString(LogConst.LOG_TIMEFORMAT) + " " + strDetail);
            txtTarget.AppendText(Environment.NewLine);
            FileLogTrace.WriteTraceLog(DateTime.Now.ToString(LogConst.LOG_TIMEFORMAT) + " " + strDetail);
        }
        #endregion
    }
}
